<?php

namespace app\index\controller;

use think\Controller;
use think\Request;
use app\common\validate\AboutMe;
use app\common\model\About;
class AboutController extends Controller
{
    /**
     * 显示资源列表
     *
     * @return \think\Response
     */
    public function index()
    {
        return view();
    }

    /**
     * 保存新建的资源
     *
     * @param  \think\Request  $request
     * @return \think\Response
     */
    public function save(Request $request,AboutMe $about)
    {
        if($about->check($data = $request->post())){
            $data['add_at']=time();
            unset($data['__token__']);
            if(About::insert($data)){
                $this->error('提交成功');
            };
        }else{
            $this->error($about->getError());
        }
    }


}
